
// getters封装state

// 用getters来取 state 的数据
export const singer = state => state.singer;

// 播发器的 getters
export const playing = state => state.playing;   // 播放状态(暂停/播放)
export const fullScreen = state => state.fullScreen; // 是否全屏
export const playlist = state => state.playlist; // 播放列表
export const sequenceList = state => state.sequenceList; // 顺序播放
export const mode = state => state.mode;  // 播放模式
export const currentIndex = state => state.currentIndex; // 当前歌曲的索引
// 通过playList 和 currentIndex 来计算出当前播放的歌曲
export const currentSong = (state) => {
  return state.playlist[state.currentIndex] || {}
};
export const disc = state => state.disc; // 歌单
export const topList = state => state.topList; // 排行版歌曲详情

export const searchHistory = state => state.searchHistory; // 历史搜索记录

export const playHistory = state => state.playHistory; // 播放历史记录
export const favoriteList = state => state.favoriteList; // 收藏列表
